/*
 * FunctionUnit.cpp
 *
 *  Created on: 2009-11-28
 *      Author: ws
 */

#include"FunctionUnit.hpp"
#include"Region.hpp"
FunctionUnit::FunctionUnit(std::string name, Region * entry, Region * exit): entry(entry), exit(exit), name(name)
{

}

Region * FunctionUnit::get_start()
{
	return entry;
}

Region* FunctionUnit::get_exit()
{
	return exit;
}
FunctionUnit::~FunctionUnit()
{
	Region * x = get_start();
	Region * prev = x;
	x = x->get_next();
	while( x)
	{
		delete prev;
		prev = x;
		x = x->get_next();
	}
	delete prev;
}

void FunctionUnit::code_gen()
{
	
}
